//
//  GradientView.swift
//  onemeetingmac
//
//  Created by 张衡 on 2020/11/10.
//  Copyright © 2020 onemeeting. All rights reserved.
//

import Foundation

class GradientView: NSView {
    var gradientColors:[NSColor]!
    convenience init(gradientColors:[NSColor]) {
        self.init()
        self.gradientColors = gradientColors
    }
    
    override func draw(_ dirtyRect: NSRect) {
        let stratcolor = NSColor.init(red: 39.0/256.0, green: 40.0/256.0, blue: 51.0/256.0, alpha: 1.0)
        let endcolor = NSColor.init(red: 10.0/256.0, green: 10.0/256.0, blue: 11.0/256.0, alpha: 1.0)
        let grad = NSGradient.init(starting: stratcolor, ending: endcolor)
        grad?.draw(in: dirtyRect, angle: 270)
    }
}
